package com.foryou.wechat.service.impl;

import com.foryou.wechat.entity.SysUserTokenEntity;
import com.foryou.wechat.mapper.SysUserTokenMapper;
import com.foryou.wechat.mapper.UserTokenMapper;
import com.foryou.wechat.service.UserTokensService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Lee.
 */
@Service
public class UserTokensServiceImpl implements UserTokensService {

    @Autowired
    private UserTokenMapper userTokenMapper;

    @Autowired
    private SysUserTokenMapper sysUserTokenMapper;

    @Override
    public Long getUserId(String token) {
        return userTokenMapper.getCurrentUserId(token);
    }

    @Override
    public SysUserTokenEntity queryByToken(String token) {
        return sysUserTokenMapper.queryByToken(token);
    }
}
